<?php
$form = $this->form;
$message = $this->message;
if($message){
?>
  <div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  <?php print_r($message); ?>
  </div>
<?php
}
?>
<div class="login">
<?php
	$form->prepare();
	$form->setAttribute('action',$this->url(NULL,array('controller'=>'auth','action'=>'authenticate')));
	$form->setAttribute('method','post');
	$form->setAttribute('class','form-horizontal');
	$form->setAttribute('role','form');
	echo $this->form()->openTag($form);
?>
	<div class="form-group">
		<?php echo $this->formLabel($form->get('username'));?>
		<?php

		echo '<div class="col-sm-4">';
		echo $this->formElement($form->get('username'));
		echo $this->formElementErrors($form->get('username'));
		echo '</div>';
		?>
	</div>

	<div class="form-group">
		<?php echo $this->formLabel($form->get('password')); ?>
		<?php

		echo '<div class="col-sm-4">';
		echo $this->formElement($form->get('password'));
		echo $this->formElementErrors($form->get('password'));
		echo '</div>';
		?>
	</div>

	<div class="form-group">
    <label for="submit" class='col-sm-4 control-label'> </label>
		<?php 
    echo '<div class="col-sm-4">';    
    echo $this->formElement($form->get('remember'));
		echo $this->formLabel($form->get('remember'));		
		echo $this->formElementErrors($form->get('remember'));
		echo '</div>';
		?>
	</div>

	<div class="form-group">
		<label for="submit" class='col-sm-4 control-label'> </label>
		<div class="col-sm-4">
		<?php echo $this->formElement($form->get('submit'));?>
		</div>
	</div>
<?php
	echo $this->form()->closeTag($form);
?>
</div>

<style>
.login{
	width: 50%;
	min-width: 600px;
	margin: 0px auto;
	padding: 0px;
}
</style>

